﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Address_Book.BLL
{
    public class LoginManager
    {
        public bool Login(string UserName, string PassWord)
        {
            if (UserName == "")
            {
                throw new Exception("用户名不能为空");
            }
            else
            {
                Address_Book.DAL.User selectUser = new Address_Book.DAL.User();
                Address_Book.Model.UserInfo user = selectUser.LoginSelect(UserName,PassWord);
                if (user != null)
                {
                    return true;
                }
                else
                {
                    throw new Exception("登陆失败！用户不存在或密码错误");
                }
            }

        }
    }
}
